package com.only4play.practice.pay.payment.kit;

import cn.hutool.core.util.ObjUtil;
import com.only4play.practice.common.enums.pay.OutPayChannelType;
import com.only4play.practice.pay.payment.kit.plugin.AliPayPaymentPlugin;
import com.only4play.practice.pay.payment.kit.plugin.WechatPaymentPlugin;

/**
 * @author mengdy
 */

public class PaymentPluginFactory {


    public static PaymentPlugin getPaymentPlugin(OutPayChannelType outPayChannelType){

        if (ObjUtil.isNull(outPayChannelType)){
            return null;
        }
        if (outPayChannelType.equals(OutPayChannelType.ALIPAY)){
            return new AliPayPaymentPlugin();
        }else if (outPayChannelType.equals(OutPayChannelType.WECHAT)){
            return new WechatPaymentPlugin();
        }
        return null;
    }
}
